package work.base.lambda;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class PredicateTest01 {

    public static void main(String args[]){


        // Predicate接口的使用
        List<String> names = Arrays.asList("Adam", "Alexander", "John", "Tom");
        List<String> result = names.stream()
                .filter(name -> name.startsWith("A"))
                .collect(Collectors.toList());

        System.out.println(result);

    }
}
